package org.budo.excel.jdbc.driver.statement.impl;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

import org.budo.excel.jdbc.driver.statement.AbstractExcelStatement;
import org.budo.jdbc.driver.AbstractBudoJdbcPreparedStatement;
import org.budo.jdbc.driver.resultset.impl.MapArrayResultSet;

/**
 * @author limingwei
 */
public class SHOW_FULL_TABLES extends AbstractExcelStatement {
    private static final String TABLE_TYPE = "Table_type";

    @Override
    public void execute(PreparedStatement preparedStatement) throws SQLException {
        String[] columnNames = new String[] { "Tables_in_" + preparedStatement.getConnection().getCatalog(), TABLE_TYPE };
        ResultSet resultSet = new MapArrayResultSet(columnNames, new Map[0]);
        ((AbstractBudoJdbcPreparedStatement) preparedStatement).setResultSet(resultSet);
    }
}